using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace AutoUpdateEngine.FileSystem
{
    /// <summary>
    /// give a simple approach to access both local and network files
    /// the default root directory will be use to transform relative pathes to absolute pathes
    /// when operating on local disk resources
    /// </summary>
    public interface IFileAccesser
    {
        /// <summary>
        /// download a file from the remote server to current user's local disk;
        /// </summary>
        /// <param name="remoteFileName"></param>
        /// <param name="destFileName">absolute or relative path</param>
        void DownloadFile(string remoteFileName, string destFileName);
        /// <summary>
        /// delete a file, on local disk only
        /// </summary>
        /// <param name="fileName">absolute or relative path</param>
        void DeleteFile(string fileName);
        /// <summary>
        /// change the file's name to a new one, on local disk only
        /// </summary>
        /// <param name="oldFileName">old file name, absolute or relative path</param>
        /// <param name="newFileName">new file name, absolute or relative path</param>
        void RenameFile(string oldFileName, string newFileName);
        /// <summary>
        /// write a stream into a file created on local disk
        /// </summary>
        /// <param name="reader">any type of IO stream</param>
        /// <param name="destFileName">absolute or relative path</param>
        void CreateFile(Stream reader, string destFileName);
        /// <summary>
        /// get working directory of this file accesser
        /// </summary>
        string RootDirectory { get;}
    }
}
